namespace ScrumSprintMonitor.Implementation.AvailableTimeCalculator
{
	#region #using Directives

	using System;

	using Infrastructure;

	#endregion

	public static class DateTimeExtensions
	{
		public static DateTime ToTeamMemberTimeZone(this DateTime dateTime, ITeamMemberInformation teamMemberInfo)
		{
			if (dateTime.Kind == DateTimeKind.Unspecified)
			{
				return dateTime;	// It is already in the target timezone
			}
			return TimeZoneInfo.ConvertTimeFromUtc(dateTime.ToUniversalTime(), teamMemberInfo.TimeZone);
		}
	}
}